import request from '@/utils/request'

// 查询私信列表
export function listMessage(query) {
  return request({
    url: '/system/message/list',
    method: 'get',
    params: query
  })
}

// 查询私信详细
export function getMessage(messageId) {
  return request({
    url: '/system/message/' + messageId,
    method: 'get'
  })
}

// 新增私信
export function addMessage(data) {
  return request({
    url: '/system/message',
    method: 'post',
    data: data
  })
}

// 修改私信
export function updateMessage(data) {
  return request({
    url: '/system/message',
    method: 'put',
    data: data
  })
}

// 删除私信
export function delMessage(messageId) {
  return request({
    url: '/system/message/' + messageId,
    method: 'delete'
  })
}

// 查询未读消息数量
export function getUnreadCount() {
  return request({
    url: '/system/message/unread/count',
    method: 'get'
  })
}

// 更新消息为已读
export function readMessage(messageId) {
  return request({
    url: '/system/message/read/' + messageId,
    method: 'put'
  })
} 